Page({
    data: {
        banks: [
            {
                name: '中国农业银行',
                icon: '/static/images/icon_agricultural_bank.png',
                
            },
            {
                name: '中国工商银行',
                icon: '/static/images/icon_industrial_bank.png',
                
            },
            {
                name: '招商银行',
                icon: '/static/images/icon_merchants_bank.png',
                
            }
        ]
    },


    addCard(e) {
        const index = e.currentTarget.dataset.index;
        const selectedBank = this.data.filteredBanks[index];
        
        // 判断是否模拟器环境
        const isSimulator = typeof my === 'object' && my.isIDE;
        
        if (isSimulator) {
          my.navigateTo({
            url: `/pages/add-card-simulate/index?bankName=${encodeURIComponent(selectedBank.name)}&bankIcon=${encodeURIComponent(selectedBank.icon)}`
          });
        } else {
          my.addCardAuth({
            cardType: 'bank',
            success: (res) => {
              // 真实环境处理逻辑...
            }
          });
        }
    },
    
})      